package com.xu.mall.product.model;

import java.io.Serializable;
import java.util.Set;

import com.xu.mall.base.category.model.ICategory;
import com.xu.mall.base.common.Constants;
import com.xu.mall.base.tree.entity.BaseTreeEntity;

/**
 * 产品分类
 */
public class ProductCategory extends BaseTreeEntity implements ICategory, Serializable {
	private static final long serialVersionUID = 756440729836269025L;
	private Boolean allowProduct;// 当前类别是否允许有产品

	private Set<ProductPropertiesConfig> properties;

	@Override
	public void setCode(String code) {
		this.code = code.startsWith(Constants.CodePrefix.ProductCategory) ? code
				: Constants.CodePrefix.ProductCategory + code;
	}

	public Boolean getAllowProduct() {
		return allowProduct;
	}

	public void setAllowProduct(Boolean allowProduct) {
		this.allowProduct = allowProduct;
	}

	public Set<ProductPropertiesConfig> getProperties() {
		return properties;
	}

	public void setProperties(Set<ProductPropertiesConfig> properties) {
		this.properties = properties;
	}

}
